#ifndef INSTRUMENT_H
#define INSTRUMENT_H

#include <QList>

#include <note.h>
#include <position.h>

class Instrument
{
public:
    Instrument();

    // Access set methods
    void setPositions(QList <Position> pos_list) { positions = pos_list; }
    void setBasePositions(QList <BasePosition> base_pos_list) { base_positions = base_pos_list; }

    void setClassName(QString class_name) { className = class_name; }
    void setInstrumentName(QString instrument_name) { instrumentName = instrument_name; }
    void setTypeName(QString type_name) { typeName = type_name; }
    void setTonaltyName(QString tonality_name) { tonalityName = tonality_name; }

    void setClef(Clef clf) { baseClef = clf; }
    void setOctave(Octave oct) { baseOct = oct; }
    void setTonality(EquiNote ton) { tonality = ton; }

    void setTransposeOctave() { transposeoct = baseOct; }
    void setTranspose() { transpose = tonality; }
    void setTransposeOctave(Octave oct) { transposeoct = oct; }
    void setTranspose(EquiNote nt) { transpose = nt; }

    // Access get methods
    QList <BasePosition> getBasePositions() { return base_positions; }
    QList <Position> getPositions() { return positions; }
    QList <Position> getPositions(Note nt);
    QList <Position> getPositions(QString bps_name);
    QList <Position> getPositions(BasePosition bps);

    QString getClassName() { return className; }
    QString getInstrumentName() { return instrumentName; }
    QString getTypeName() { return typeName; }
    QString getTonaltyName() { return tonalityName; }

    Clef getClef() { return baseClef; }
    Octave getOctave() { return baseOct; }
    EquiNote getTonality() { return tonality; }

    Note getTonalityNote() { return Note(tonality, baseOct); }
    Note getTranposeNote() { return Note(transpose,transposeoct); }
    Octave getTranposeOctave() { return transposeoct; }
    EquiNote getTransposeEquiNote() { return transpose; }

    Note getRealNote(Note readed_note);
    Note getReadedNote(Note real_note);

    bool isTransposingInstrument() { if (getTonalityNote() == getTranposeNote()) return false; else return true; }

private:
    QString className;
    QString instrumentName;
    QString typeName;
    QString tonalityName;

    QString description;

    EquiNote tonality;
    Octave baseOct;
    Clef baseClef;

    Octave transposeoct;
    EquiNote transpose;

    QList <Position> positions;
    QList <BasePosition> base_positions;

    // TODO: range, warning, ect...
};

#endif // INSTRUMENT_H
